//This program is free software: you can redistribute it and/or modify
//it under the terms of the GNU General Public License as published by
//the Free Software Foundation, either version 3 of the License, or
//(at your option) any later version.
//
//This program is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//GNU General Public License for more details.
//
//You should have received a copy of the GNU General Public License
//along with this program.  If not, see <http://www.gnu.org/licenses/>.

#ifndef TACHOMETERUI_H
#define TACHOMETERUI_H

#include <QtGui/QDialog>
#include <QVBoxLayout>
#include <QSettings>
#include "tachometerwidget.h"
#include "robotwidget.h"
#include "camerawidget.h"
#include "camera.h"
#include "cangateway.h"

namespace Ui
{
    class TachometeruiClass;
}

/*
  ProzessLeitSystem is a main window

  The custom view is restored everytime ProzessLeitSystem is created. It uses
  QSettings, which needs to be configured in an application scope.
  For example:
    QCoreApplication::setOrganizationName("bht-berlin");
    QCoreApplication::setOrganizationDomain("bht-berlin.de");
    QCoreApplication::setApplicationName("pls");
 */
class ProzessLeitSystem : public QDialog
{
    Q_OBJECT

public:
    ProzessLeitSystem(QWidget *parent = 0);
    ~ProzessLeitSystem();
    static ProzessLeitSystem * instanze;
    bool camLogCheckBox();
    bool canLogCheckBox();
private:
    void addTachometer(quint16 baseid, CanGateway * canGateway);
    void addRobot(quint16 id, QString host, quint16 port, QColor *color = 0);

private:

        Ui::TachometeruiClass *ui;
    QVBoxLayout *tachoLayout;
    QVBoxLayout *robotLayout;
    Camera *camera;
    CanGateway * canGateway;
    QSettings settings;

private slots:
    void on_pushButton_clicked();
    void on_cameraReconnectButton_clicked();
    void on_canReconnectButton_clicked();
    void on_addTacho_clicked();
    void on_addRobot_clicked();
};

#endif // TACHOMETERUI_H
